$OpenBSD: patch-ldapvi_c,v 1.2 2017/04/14 08:24:03 ajacoutot Exp $

rename getline to avoid future namespace collision, upstream git 256ced029c
remove pointless header which vim whines about
fix build with clang: 'copy_sasl_output' should return a value [-Wreturn-type]

--- ldapvi.c.orig	Sat May  5 12:17:26 2007
+++ ldapvi.c	Fri Apr 14 10:20:13 2017
@@ -470,7 +470,7 @@ change_mechanism(bind_options *bo)
 		bo->authmethod = LDAP_AUTH_SASL;
 		puts("Switching to SASL authentication.");
 	}
-	bo->sasl_mech = getline("SASL mechanism", bo->sasl_mech);
+	bo->sasl_mech = ldapvi_getline("SASL mechanism", bo->sasl_mech);
 }
 
 static int
@@ -1414,7 +1414,7 @@ write_file_header(FILE *s, cmdline *cmdline)
 	int nlines = 0;
 
 	if (print_binary_mode == PRINT_UTF8 && !cmdline->ldif) {
-		fputs("# -*- coding: utf-8 -*- vim:encoding=utf-8:\n", s);
+		fputs("# -*- coding: utf-8 -*-\n", s);
 		nlines++;
 	}
 	if (cmdline->ldif) {
@@ -1465,7 +1465,7 @@ copy_sasl_output(FILE *out, char *sasl)
 	int line = 0;
 	int c;
 
-	if (lstat(sasl, &st) == -1) return;
+	if (lstat(sasl, &st) == -1) return 0;
 	if ( !(in = fopen(sasl, "r"))) syserr();
 
 	if (st.st_size > 0) {
